#{extends 'Discount/discount.html' /}

#{set selected:'offer' /}

#{set 'moreStyles'}
    <link rel="stylesheet" type="text/css" href="@{'/public/stylesheets/dateinput.css'}"/>
#{/ set}

#{form @Discount.submitDiscount(), method:'GET'}
<table>
<tr>
    <td>
    <label for="description">Description:</label>
    </td>
    <td><textarea name="description" id="description" rows="10" cols="100%"></textarea><br/>
    </td>
</tr>
<tr>
    <td>
    <label for="expirationDate">Valid until[MM/DD/YY]:</label>
    </td>
    <td>
    <input class="text" type="date" id="expirationDate" name="expirationDate"><br/>
    </td>
</tr>
<tr>
    <td>
    <label for="discountReceiver">${userRole}:</label>
    </td>
    <td>
    
    <select name="discountReceiverId"> 
	#{list items:discountReceivers, as:'receiver'} 
    	<option value="${receiver.id}">${receiver.name}</option> 
	#{/list} 
	</select> 
    </td>
<tr>
    <td>    
    <label for="picUrl">Image:</label>
    </td>
    <td>
    <input type="file" id="picUrl" name="picUrl" /><br/>
    </td>
</tr>
<tr>
    <td>
    </td>
    <td>
    <input class="button" type="submit" value="Send Offer" />
    <input class="button" type="reset" value="reset" />
    </td>
</tr>
</table>

<script type="text/javascript">
$(document).ready(function() {
    $(":date").dateinput({firstDay: 1});
});
</script>
#{/ form}